﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Principal;

namespace WSIMServices.model
{
    public class WSIMPrincipal:IPrincipal
    {
        #region IPrincipal Members

        private IIdentity id;
        private List<String> roles;

        public WSIMPrincipal(IIdentity identity,List<String> roles)
        {
            this.id = identity;
            this.roles = roles;
        }

        public IIdentity Identity
        {
            get { return id; }
        }

        public bool IsInRole(string role)
        {
            return roles.Contains(role);
        }

        #endregion
    }
}
